<!DOCTYPE html>
<html>
<head>
    <title>规则集管理页面</title>
</head>
<link href="/static/css/controls.css" rel="stylesheet" type="text/css">
<script>var ctx = '';
var basePath = '/gillion-web';</script>
<script src="/bower_components/requirejs/require.js" data-main="/static/app.js" data-bootstrap-modules="'system/ruleExpression/RuleAssemblyModule'"></script>
<body ng-controller="RuleAssemblyController" ng-cloak>

<h1>{{rulePackage.name}}--规则集列表</h1>
规则集名称：<input type="text" ng-model="search.name">

<button ng-click="searchRuleAssembly()">查询</button>
<button ng-click="showAddView()">新增</button>
<g-data-source url="/grule-manager/ruleAssembly" data-params="search" data-source-name="ruleAssemblySource" page="true" allow-auto-load="true"></g-data-source>
<br>
<br>
<br>
<hr>
<div ng-show="showPage">
    <g-data-grid data-source-name="ruleAssemblySource"
                 data-on-load-success="ruleAssemblyGridRendered(grid)"
                 data-checked-rows="sysCheckedRows"
                 on-select="selectRow(record)"
                 g-height="300"
                 ng-cloak>
        <g-column width="20%" data="name" >规则集名称
        </g-column>
        <g-column width="200" data="conditions" >
            条件
        </g-column>
        <g-column width="200" data="priority" >
            优先级
        </g-column>
        <g-column width="250px">
            <i class="fi fi-set"></i>&nbsp;操作
            <g-column-tmpl>
                <g-action-remove on-before-action="onRemoveRecord($event, record)"></g-action-remove>
                <a href="javascript:" ng-click="grid.actions.edit(row)">编辑</a>
                <a target="_blank" href="/html/variables/manager#/?scope=2&scopeId={{row.id}}" >添加规则集变量</a>
                <a href="/html/ruleExpression/ruleManager#/?ruleAssemblyId={{row.id}}" >添加规则</a>
            </g-column-tmpl>
        </g-column>
    </g-data-grid>
    <g-pagination-navi source-name="ruleAssemblySource"></g-pagination-navi>
    <g-pagination-size source-name="ruleAssemblySource"></g-pagination-size>
</div>
</div>
<div ng-show="showAdd">
    <textarea ng-model="addRuleAssembly" rows="30" cols="100">
    </textarea>
    <button ng-click="createRuleAssembly()">保存</button>
    <button ng-click="showPageView()">返回</button>
</div>
<div ng-show="showEdit">
    id: <input readonly="readonly" ng-model="currId"><br>
    <textarea ng-model="editRuleAssembly" rows="30" cols="100" >
    </textarea>
    <button ng-click="updateRuleAssembly()">保存</button>
    <button ng-click="showPageView()">返回</button>
</div>

</body>
</html>
